home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / IIGS / TN.IIGS.066 < prev    next >
Encoding:
Text File  |  1990-09-21  |  5.2 KB  |  117 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6. Apple IIgs
  7. #66:    ExpressLoad Philosophy
  8.  
  9. Revised by:    Dave Lyons    September 1990
  10. Written by:    Matt Deatherage    September 1989
  11.  
  12. This Technical Note discusses the ExpressLoad feature and how it relates to 
  13. the standard Loader and your application.
  14. Changes since September 1989:  Removed the warning about Close with reference 
  15. number zero.
  16. _____________________________________________________________________________
  17.  
  18.  
  19. Speedy the Loader Helper
  20.  
  21. ExpressLoad is a GS/OS feature which is usually present with System Software 
  22. 5.0.  The system does not load it on machines with 512K or less RAM, and there 
  23. is always the chance that someone has removed it from the System directory.
  24.  
  25. ExpressLoad operates on Object Module Format (OMF) files which have been 
  26. "expressed," using either the APW tool Express (or it's MPW counterpart, 
  27. ExpressIIgs) or created that way by a linker.  Expressed files contain a 
  28. dynamic data segment named either ExpressLoad or ~ExpressLoad at the beginning 
  29. of the file. (Current versions of Express and ExpressIIgs create ~ExpressLoad 
  30. segments, which is the preferred naming convention; older versions created 
  31. ExpressLoad segments, and should be re-Expressed for future compatibility.)  
  32. This segment contains information ExpressLoad uses to load the files more 
  33. quickly than the System Loader, including such things as file offsets to 
  34. segment headers, mappings of old segment numbers to new segment numbers (these 
  35. files may have their segments rearranged for optimal performance), and file 
  36. offsets to relocation dictionaries.
  37.  
  38.  
  39. Two Loaders, Two Missions, One Function
  40.  
  41. The System Loader's function is to interpret OMF.  It takes files on disk (or 
  42. in memory) and transforms them from load files into relocated 65816 code.  It 
  43. does this very well, but in a very straightforward way.  For example, when the 
  44. System Loader sees the instruction to right-shift a value n times, it loads a 
  45. register with the value and performs a right-shift n times.
  46.  
  47. ExpressLoad has a different mission.  It relies upon the System Loader to 
  48. handle OMF in a straightforward fashion so it can concentrate upon handling 
  49. the most common OMF cases in the fastest possible way.  For example, when 
  50. asked for a specific segment in a load file, the System Loader "walks" the OMF 
  51. until it finds the desired segment.  ExpressLoad, however, goes directly to 
  52. the desired segment since an Expressed file contains precalculated offsets to 
  53. each segment in the ExpressLoad segment.
  54.  
  55. Since ExpressLoad focuses on the common things performed by the majority of 
  56. applications, it may not support those applications which rely upon certain 
  57. features of OMF or the System Loader.  In these cases, the System Loader loads 
  58. the file as is expected.
  59.  
  60. ExpressLoad always gets first crack at loading a file, and if it is an 
  61. Expressed file that ExpressLoad can handle, it loads it.  If the file is not 
  62. an Expressed file, the System Loader loads it instead.  It is the same process 
  63. when working with a file that has already been loaded (i.e., loading or 
  64. unloading segments).
  65.  
  66. Because an Expressed file is a standard OMF file with an additional segment, 
  67. Expressed files are almost fully compatible with the System Loader (although 
  68. it cannot load them any faster than before).  Refer the following section for 
  69. potential problems.
  70.  
  71.  
  72. Working With ExpressLoad
  73.  
  74. As ExpressLoad is intimate in its relationship with the System Loader, most 
  75. applications work seamlessly with it; however, there are some potential 
  76. problems about which you should be aware.
  77.  
  78.   o  Don't mix Expressed files and normal OMF files with the same user 
  79.      ID.  For example, if your application uses InitialLoad with a 
  80.      separate file, make sure that if it and your main application 
  81.      share the same user ID that they are both either Expressed files 
  82.      or normal OMF files.
  83.  
  84.   o  Don't use a user ID of zero.  In the past, use of zero told the 
  85.      System Loader to use the current user ID; however, now both the 
  86.      System Loader and ExpressLoad have a current user ID.  Be specific 
  87.      about user IDs when loading.
  88.  
  89.   o  Avoid loading and unloading segments by number.  Since Expressed 
  90.      files may have their segments rearranged, if an Expressed file is 
  91.      loaded by the System Loader, references to segments by number may 
  92.      be incorrect.
  93.  
  94.   o  Avoid using GetLoadSegInfo.  This call returns System Loader data 
  95.      structures which are not supported by ExpressLoad.
  96.  
  97.   o  Don't try to load segments in files which have not been loaded 
  98.      with the call InitialLoad.  This process was never a very good 
  99.      idea, and it is now apt to cause problems.
  100.  
  101.   o  Don't have segments that link to other files.  ExpressLoad does 
  102.      not support this type of link.
  103.  
  104.  
  105. Close With Reference Number Zero
  106.  
  107. This Note previously said not to call Close with a reference number of zero, 
  108. because that could close files out from underneath the Loader.  This is no 
  109. longer a concern, because the Loaders open files in a way that protects them 
  110. from being closed.
  111.  
  112.  
  113. Further Reference
  114. _____________________________________________________________________________
  115.   o  GS/OS Reference
  116.  
  117.